/*
 * @Author: chen haoxuan
 * @Date: 2021-05-05 15:53:34
 * @LastEditTime: 2021-05-05 16:07:30
 */
//* 析构函数
#include<iostream>
#include<string>
using namespace std;
class Student
{
    public:
        Student(int n,string nam,char s)
        {   
            num=n;
            name = nam;
            sex =s;
            cout<<"Constructor is called"<<endl;
        }
        ~Student()
        {
            cout<<"Destructor is called"<<endl;
        }
        void display()
        {
            cout<<"num: "<<num<<endl;
            cout<<"name: "<<name<<endl;
            cout<<"sex: "<<sex<<endl<<endl;
        }
    private:
        int num;
        string name;
        char sex;
};
int main()
{
    Student stud1(10010,"wang_li",'f');
    stud1.display();
    Student stud2(10011,"zhang_fan",'m');
    stud2.display();
    return 0;
}